<?php

namespace app\admin\service;

use app\admin\model\Alliance;
use think\facade\Db;

class AllianceService extends BaseService
{
    public function __construct()
    {
        $this->model = new Alliance();
    }

    public function getList()
    {


        $list = Db::name('mini_alliance')->where('mark','1')

              ->whereNotNull('news')
             ->order('id desc')->page(PAGE, PERPAGE)
            ->select();



        $count = Db::name('mini_alliance')->where('mark','1')
            ->whereNotNull('news')
            ->order('id desc')->page(PAGE, PERPAGE)
            ->count();


        //返回结果
        $message = array(
            "msg" => '操作成功',
            "code" => 0,
            "data" => $list,
            "count" => $count,
        );
        return $message;

    }

}